import { dateFormat } from '@/common/utils/common'

export const substr = (value, len = 10, addon = '...') => {
  return value && value.length > len ? `${value.substring(0, len)}${addon}` : value
}

export const dotNum = (str = '') => {
  return (str + '').replace(/\B(?=(\d{3})+(?!\d))/g, ',')
}

export const toDate = (value, str = 'yyyy.MM.dd') => {
  return dateFormat(value, str)
}
